package com.mallcloud.mall.mall.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Optional;

@ApiModel(value = "ProGivenCoupon", description = "券转赠过程对象")
@Data
@ToString
public class ProGivenCoupon {

	@ApiModelProperty(value = "转赠者卡号")
	private String cardNoOfTransferor;
	@ApiModelProperty(value = "赠送券号(逗号拼接)")
	private String givenCouponNumber;
	@ApiModelProperty(value = "接收人手机号码")
	private String receiverPhone;

	@ApiModelProperty(value = "返回id 0-转赠成功 1-转赠失败", hidden = true)
	private Integer messageId;
	@ApiModelProperty(value = "返回信息", hidden = true)
	private String message;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
